import React from 'react';

import s from './style.module.less';

export default function AwardItem(props) {
  let image;
  if (props.type !== 0) {
    image = (
      <div className={s.image}>
        <img src={props.award_image} alt="image" />
      </div>
    );
  } else {
    image = <div className={s.lotteryText}> 抽奖 </div>;
  }

  return (
    <div
      className={[
        props.award_name ? s.turntableItem : '',
        s.item,
        props.type !== 0 ? '' : s.lottery,
        props.index === props.curIndex ? s.chosen : '',
      ].join(' ')}
      onClick={props.type === 0 ? props.onClick : null}
    >
      {props.award_name ? image : ''}
      {props.award_name ? <div className={s.text}>{props.award_name}</div> : ''}
    </div>
  );
}
